
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/physics/mechanics/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:27:32 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Classical Mechanics &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
    <script src="../../../_static/jquery.js"></script>
    <script src="../../../_static/underscore.js"></script>
    <script src="../../../_static/doctools.js"></script>
    <script src="../../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../../_static/sympy-notailtext-favicon.ico"/>
    <link href="index.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />
    <link rel="next" title="Masses, Inertias, Particles and Rigid Bodies in Physics/Mechanics" href="masses.html" />
    <link rel="prev" title="Docstrings for basic field functions" href="../vector/api/fieldfunctions.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="masses.html" title="Masses, Inertias, Particles and Rigid Bodies in Physics/Mechanics"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../vector/api/fieldfunctions.html" title="Docstrings for basic field functions"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../index.html" accesskey="U">Physics</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Classical Mechanics</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="classical-mechanics">
<span id="id1"></span><h1>Classical Mechanics<a class="headerlink" href="#classical-mechanics" title="Permalink to this headline">¶</a></h1>
<div class="topic">
<p class="topic-title">Abstract</p>
<p>In this documentation many components of the physics/mechanics module will
be discussed. <a class="reference internal" href="#module-sympy.physics.mechanics" title="sympy.physics.mechanics"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sympy.physics.mechanics</span></code></a> has been written to allow for creation of
symbolic equations of motion for complicated multibody systems.</p>
</div>
<span class="target" id="module-sympy.physics.mechanics"></span><section id="vector">
<h2>Vector<a class="headerlink" href="#vector" title="Permalink to this headline">¶</a></h2>
<p>This module derives the vector-related abilities and related functionalities
from <a class="reference internal" href="../vector/index.html#module-sympy.physics.vector" title="sympy.physics.vector"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sympy.physics.vector</span></code></a>. Please have a look at the documentation of
<a class="reference internal" href="../vector/index.html#module-sympy.physics.vector" title="sympy.physics.vector"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sympy.physics.vector</span></code></a> and its necessary API to understand the vector capabilities
of <a class="reference internal" href="#module-sympy.physics.mechanics" title="sympy.physics.mechanics"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sympy.physics.mechanics</span></code></a>.</p>
</section>
<section id="mechanics">
<h2>Mechanics<a class="headerlink" href="#mechanics" title="Permalink to this headline">¶</a></h2>
<p>In physics, mechanics describes conditions of rest (statics) or motion
(dynamics). There are a few common steps to all mechanics problems. First, an
idealized representation of a system is described. Next, we use physical laws
to generate equations that define the system’s behavior. Then, we solve these
equations, sometimes analytically but usually numerically. Finally, we extract
information from these equations and solutions. The current scope of the module
is multi-body dynamics: the motion of systems of multiple particles and/or
rigid bodies. For example, this module could be used to understand the motion
of a double pendulum, planets, robotic manipulators, bicycles, and any
other system of rigid bodies that may fascinate us.</p>
<p>Often, the objective in multi-body dynamics is to obtain the trajectory of a
system of rigid bodies through time. The challenge for this task is to first
formulate the equations of motion of the system. Once they are formulated, they
must be solved, that is, integrated forward in time. When digital computers
came around, solving became the easy part of the problem. Now, we can
tackle more complicated problems, which leaves the challenge of formulating the
equations.</p>
<p>The term “equations of motion” is used to describe the application of Newton’s
second law to multi-body systems. The form of the equations of motion depends
on the method used to generate them. This package implements two of these
methods: Kane’s method and Lagrange’s method. This module facilitates the
formulation of equations of motion, which can then be solved (integrated) using
generic ordinary differential equation (ODE) solvers.</p>
<p>The approach to a particular class of dynamics problems, that of forward
dynamics, has the following steps:</p>
<ol class="arabic simple">
<li><p>describing the system’s geometry and configuration,</p></li>
<li><p>specifying the way the system can move, including constraints on its motion</p></li>
<li><p>describing the external forces and moments on the system,</p></li>
<li><p>combining the above information according to Newton’s second law
(<span class="math notranslate nohighlight">\(\mathbf{F}=m\mathbf{a}\)</span>), and</p></li>
<li><p>organizing the resulting equations so that they can be integrated to obtain
the system’s trajectory through time.</p></li>
</ol>
<p>Together with the rest of SymPy, this module performs steps 4 and 5,
provided that the user can perform 1 through 3 for the module. That is to say,
the user must provide a complete representation of the free
body diagrams that themselves represent the system, with which this code can
provide equations of motion in a form amenable to numerical integration. Step
5 above amounts to arduous algebra for even fairly simple multi-body systems.
Thus, it is desirable to use a symbolic math package, such as Sympy, to
perform this step. It is for this reason that this module is a part of Sympy.
Step 4 amounts to this specific module, sympy.physics.mechanics.</p>
</section>
<section id="guide-to-mechanics">
<h2>Guide to Mechanics<a class="headerlink" href="#guide-to-mechanics" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="masses.html">Masses, Inertias, Particles and Rigid Bodies in Physics/Mechanics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="masses.html#mass">Mass</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#particle">Particle</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#inertia">Inertia</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#rigid-body">Rigid Body</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#dyadic">Dyadic</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#linear-momentum">Linear Momentum</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#angular-momentum">Angular Momentum</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#using-momenta-functions-in-mechanics">Using momenta functions in Mechanics</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#kinetic-energy">Kinetic Energy</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#potential-energy">Potential Energy</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#lagrangian">Lagrangian</a></li>
<li class="toctree-l2"><a class="reference internal" href="masses.html#using-energy-functions-in-mechanics">Using energy functions in Mechanics</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="kane.html">Kane’s Method in Physics/Mechanics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="kane.html#structure-of-equations">Structure of Equations</a></li>
<li class="toctree-l2"><a class="reference internal" href="kane.html#id2">Kane’s Method in Physics/Mechanics</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="lagrange.html">Lagrange’s Method in Physics/Mechanics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="lagrange.html#structure-of-equations">Structure of Equations</a></li>
<li class="toctree-l2"><a class="reference internal" href="lagrange.html#id1">Lagrange’s Method in Physics/Mechanics</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="symsystem.html">Symbolic Systems in Physics/Mechanics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="symsystem.html#symbolicsystem-example-usage">SymbolicSystem Example Usage</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="linearize.html">Linearization in Physics/Mechanics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="linearize.html#background">Background</a></li>
<li class="toctree-l2"><a class="reference internal" href="linearize.html#linearizing-kane-s-equations">Linearizing Kane’s Equations</a></li>
<li class="toctree-l2"><a class="reference internal" href="linearize.html#linearizing-lagrange-s-equations">Linearizing Lagrange’s Equations</a></li>
<li class="toctree-l2"><a class="reference internal" href="linearize.html#potential-issues">Potential Issues</a></li>
<li class="toctree-l2"><a class="reference internal" href="linearize.html#further-examples">Further Examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples for Physics/Mechanics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="examples/rollingdisc_example.html">A rolling disc</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples/bicycle_example.html">A bicycle</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples/lin_pend_nonmin_example.html">Nonminimal Coordinates Pendulum</a></li>
<li class="toctree-l2"><a class="reference internal" href="examples/multi_degree_freedom_holonomic_system.html">Multi Degree of Freedom Holonomic System</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="advanced.html">Potential Issues/Advanced Topics/Future Features in Physics/Mechanics</a><ul>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#common-issues">Common Issues</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#advanced-interfaces">Advanced Interfaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="advanced.html#future-features">Future Features</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">References for Physics/Mechanics</a></li>
<li class="toctree-l1"><a class="reference internal" href="autolev_parser.html">Autolev Parser</a><ul>
<li class="toctree-l2"><a class="reference internal" href="autolev_parser.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="autolev_parser.html#usage">Usage</a></li>
<li class="toctree-l2"><a class="reference internal" href="autolev_parser.html#gotchas">Gotchas</a></li>
<li class="toctree-l2"><a class="reference internal" href="autolev_parser.html#limitations-and-issues">Limitations and Issues</a></li>
<li class="toctree-l2"><a class="reference internal" href="autolev_parser.html#future-improvements">Future Improvements</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="sympy_mechanics_for_autolev_users.html">SymPy Mechanics for Autolev Users</a><ul>
<li class="toctree-l2"><a class="reference internal" href="sympy_mechanics_for_autolev_users.html#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="sympy_mechanics_for_autolev_users.html#some-key-differences">Some Key Differences</a></li>
<li class="toctree-l2"><a class="reference internal" href="sympy_mechanics_for_autolev_users.html#rough-autolev-sympy-equivalents">Rough Autolev-SymPy Equivalents</a></li>
<li class="toctree-l2"><a class="reference internal" href="sympy_mechanics_for_autolev_users.html#numerical-evaluation-and-visualization">Numerical Evaluation and Visualization</a></li>
<li class="toctree-l2"><a class="reference internal" href="sympy_mechanics_for_autolev_users.html#links">Links</a></li>
</ul>
</li>
</ul>
</div>
</section>
<section id="mechanics-api">
<h2>Mechanics API<a class="headerlink" href="#mechanics-api" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="api/part_bod.html">Masses, Inertias &amp; Particles, RigidBodys (Docstrings)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api/part_bod.html#module-sympy.physics.mechanics.particle">Particle</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/part_bod.html#module-sympy.physics.mechanics.rigidbody">RigidBody</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/part_bod.html#inertia">inertia</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/part_bod.html#inertia-of-point-mass">inertia_of_point_mass</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/part_bod.html#linear-momentum">linear_momentum</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/part_bod.html#angular-momentum">angular_momentum</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/part_bod.html#kinetic-energy">kinetic_energy</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/part_bod.html#potential-energy">potential_energy</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/part_bod.html#lagrangian">Lagrangian</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api/kane_lagrange.html">Kane’s Method &amp; Lagrange’s Method (Docstrings)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api/kane_lagrange.html#module-sympy.physics.mechanics.kane">KaneMethod</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/kane_lagrange.html#module-sympy.physics.mechanics.lagrange">LagrangesMethod</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api/system.html">SymbolicSystem (Docstrings)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api/system.html#module-sympy.physics.mechanics.system">SymbolicSystem</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api/linearize.html">Linearization (Docstrings)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api/linearize.html#module-sympy.physics.mechanics.linearize">Linearizer</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api/expr_manip.html">Expression Manipulation (Docstrings)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api/expr_manip.html#msubs">msubs</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/expr_manip.html#find-dynamicsymbols">find_dynamicsymbols</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api/printing.html">Printing (Docstrings)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api/printing.html#mechanics-printing">mechanics_printing</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/printing.html#mprint">mprint</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/printing.html#mpprint">mpprint</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/printing.html#mlatex">mlatex</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api/body.html">Body (Docstrings)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api/body.html#module-sympy.physics.mechanics.body">Body</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api/joint.html">Joint (Docstrings)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="api/joint.html#joint">Joint</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/joint.html#pinjoint">PinJoint</a></li>
<li class="toctree-l2"><a class="reference internal" href="api/joint.html#prismaticjoint">PrismaticJoint</a></li>
</ul>
</li>
</ul>
</div>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../../index.html">
              <img class="logo" src="../../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Classical Mechanics</a><ul>
<li><a class="reference internal" href="#vector">Vector</a></li>
<li><a class="reference internal" href="#mechanics">Mechanics</a></li>
<li><a class="reference internal" href="#guide-to-mechanics">Guide to Mechanics</a></li>
<li><a class="reference internal" href="#mechanics-api">Mechanics API</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="../vector/api/fieldfunctions.html"
                        title="previous chapter">Docstrings for basic field functions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="masses.html"
                        title="next chapter">Masses, Inertias, Particles and Rigid Bodies in Physics/Mechanics</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../_sources/modules/physics/mechanics/index.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="masses.html" title="Masses, Inertias, Particles and Rigid Bodies in Physics/Mechanics"
             >next</a> |</li>
        <li class="right" >
          <a href="../vector/api/fieldfunctions.html" title="Docstrings for basic field functions"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../index.html" >Physics</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Classical Mechanics</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/physics/mechanics/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:27:34 GMT -->
</html>